package org.lds.hotkey.console.autoconfigure;

import org.lds.hotkey.console.remote.ConsoleClient;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ConsoleProperties.class})
public class ConsoleAutoConfiguration {

    private ConsoleProperties consoleProperties;

    public ConsoleAutoConfiguration(ConsoleProperties consoleProperties) {
        this.consoleProperties = consoleProperties;
    }

    @Bean
    public ConsoleClient consoleClient() {
        return new ConsoleClient(consoleProperties.getEndpoint());
    }
}
